package com.palfund.notification;

import android.app.NotificationManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        setTitle("SecondActivity");
        Intent intent = getIntent();
        String info = intent.getStringExtra("info");
        Toast.makeText(this, info, Toast.LENGTH_SHORT).show();
        if ("cancel".equals(info)) {
            NotificationManager manager = (NotificationManager) getSystemService
                    (NOTIFICATION_SERVICE);
            manager.cancel(8);
        }
    }
}
